package com.namo.cchapi.service.impl;

import com.google.gson.JsonObject;
import com.namo.cchapi.service.MessageCaptchaService;
import com.namo.cchapi.util.Bmob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author WangXin
 * @date 2021/4/12 20:37
 */
@Service
public class MessageCaptchaServiceImpl implements MessageCaptchaService {
    @Autowired
    Bmob bmob;

    @Override
    public String sendMessage(String phoneNumber){
        JsonObject jsonObject = bmob.sendMessage(phoneNumber);
        return jsonObject.toString();
    }



    @Override
    public String checkMessage(String phoneNumber,String code){
        JsonObject jsonObject = bmob.checkCode(phoneNumber,code);
        return jsonObject.toString();
    }
}
